//package cn.stylefeng.guns.modular.demo;
//
//import cn.hutool.core.codec.Base64Encoder;
//import com.alibaba.fastjson.JSON;
//import com.azure.identity.ClientCertificateCredential;
//import com.azure.identity.ClientCertificateCredentialBuilder;
//import com.microsoft.graph.models.UserActivityCollectionResponse;
//import com.microsoft.graph.serviceclient.GraphServiceClient;
//import com.microsoft.graph.users.item.UserItemRequestBuilder;
//import com.microsoft.graph.users.item.getmembergroups.GetMemberGroupsRequestBuilder;
//
//public class Test {
//
//    public static void main(String[] args) throws Exception {
////        String code = "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZyakNDQTVZQ0NRRE1RMVVMeFBXeDVEQU5CZ2txaGtpRzl3MEJBUXNGQURDQm1ERUxNQWtHQTFVRUJoTUMKUTA0eEN6QUpCZ05WQkFnTUFsTklNUXN3Q1FZRFZRUUhEQUpUU0RFT01Bd0dBMVVFQ2d3RlMyVnljbmt4Q3pBSgpCZ05WQkFzTUFsUkpNU1V3SXdZRFZRUUREQnh3WkcxekxXbHVkR1Z5Ym1Gc0xtdGxjbko1YjI1MmFYQXVZMjl0Ck1Tc3dLUVlKS29aSWh2Y05BUWtCRmh4cWIyVnNMbUpvTG5wb1lXNW5RR3RsY25KNWNISnZjSE11WTI5dE1CNFgKRFRJeU1EY3dNVEEzTXpreU5Wb1hEVE15TURZeU9EQTNNemt5TlZvd2daZ3hDekFKQmdOVkJBWVRBa05PTVFzdwpDUVlEVlFRSURBSlRTREVMTUFrR0ExVUVCd3dDVTBneERqQU1CZ05WQkFvTUJVdGxjbko1TVFzd0NRWURWUVFMCkRBSlVTVEVsTUNNR0ExVUVBd3djY0dSdGN5MXBiblJsY201aGJDNXJaWEp5ZVc5dWRtbHdMbU52YlRFck1Da0cKQ1NxR1NJYjNEUUVKQVJZY2FtOWxiQzVpYUM1NmFHRnVaMEJyWlhKeWVYQnliM0J6TG1OdmJUQ0NBaUl3RFFZSgpLb1pJaHZjTkFRRUJCUUFEZ2dJUEFEQ0N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Es4UGlQdEI3SVloVUpRZkFFbGt2RTNoClU3NXJHVjdwb0JZQkp3ai9GSHZkb1M1RUYzNStPVjZLWjBoRlpJdjF6OVhkalNlR0xlWWk4YUt2UDV5T0Jra0wKcE8wRUkvQ2l3MVVXcG1XMTJBY0p4Ymh4S0UyaUduOUNqQnBybFhpRVBFSEV1U21ndGxDUDVVbVVlUU9tbmFZMwpxRGlJS1V0QVBqTW8xc0lKMUZ6dmphenlRSWx2cXJVRXNUR054VExVL3RBNHI1RTV5YjYveFNYU2tIMXoydElzCjZDY1BPM3lxY0E5WU5rMUVGeVZ3VTdXSFl4R2Rqd05XYm5CSldZbHJZNDJwTmdJc29vUVIxbHNzMFVJK3BRN1gKUVpXVGJLQUFSZXZsMWpGNXUxajJZRXNtcERSbk9zV1BtV29TQlhJdVBKRlF5NjRoY28wa05sVnlseldpSWVTNgpvWkdCTVM4cFFqVUsvQTlnOTdpZlh2cDFVTDlzaGRhb1JDSnVoUk1Ud3lHY1VYRTVwS2hSNGFUTld5eFh4ZkdVClpUKzQ4amRleGZTWm9MOGhTNDcvYURHbS9ieE1OL04zZjEvK3FEeDE1NFVhOWF0Snl1YWVoWjF3ZXFYbG9jSW4KVGhwSTZkYWxzZjVQeFBCenVTS2FyQktURnZlUFlENnllZ25uL3RrV3VKL3VaeExZWGRveGtycVFIeElCZDNWcgozMFcyZjBmbzRtMWIvNHNvZ3ZSY1FUS1FsRHoyV3lTdzdqeTRBZVM2YW9BYUVTK0xrdzc3NEdyclpER0pmWVJDCjVOajdJckhSdk5HMG9obUtETGdaWTh1eAotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==";
//        String path = "/Users/quspacedragon/Downloads/PDMS-kpltest-certificates/mabi.pem";
//
////        // Load the CRT file
////        byte[] fileBytes = Files.readAllBytes(Paths.get(path));
////
////        // Encode the byte array to a Base64 string
////        String base64String = Base64.getEncoder().encodeToString(fileBytes);
////
////        System.out.println(base64String);
////
////        byte[] decode = Base64.getDecoder().decode(base64String);
////        System.out.println(new String(decode));
//
//        final String clientId = "438b462a-c179-4575-8ef1-87ea35f42e59";
//        final String tenantId = "f074dbeb-1cc3-4857-a3ba-17253091f5d3";
////        final String clientCertificatePath = "MyCertificate.pem";
//
//// The client credentials flow requires that you request the
//// /.default scope, and pre-configure your permissions on the
//// app registration in Azure. An administrator must grant consent
//// to those permissions beforehand.
//        final String[] scopes = new String[]{"https://graph.microsoft.com/.default"};
//
//        final ClientCertificateCredential credential = new ClientCertificateCredentialBuilder()
//                .clientId(clientId).tenantId(tenantId)
//                .pemCertificate(path)
////                .pemCertificate(new ByteArrayInputStream(decode))
//                .build();
//
//
//        final GraphServiceClient graphClient = new GraphServiceClient(credential, scopes);
//        UserItemRequestBuilder me = graphClient.me();
//        GetMemberGroupsRequestBuilder memberGroups = me.getMemberGroups();
////        UserActivityCollectionResponse userActivityCollectionResponse = me.activities().get();
//        System.out.println(JSON.toJSONString(memberGroups));
//
//    }
//}
